<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml" 
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets">  

    <ui:composition template="../template.xhtml">
        <ui:define name="tituloPagina">
            #{msgs.editar} #{msgs.ministrante}
        </ui:define>
        <ui:define name="conteudo">
            <h:panelGroup rendered="#{beanMinistrante.edit}">
                <p class="valoresCabecalho">
                    #{msgs.editar} #{msgs.ministrante}
                </p>
                <h:form>
                    <h:panelGrid class="panelGrid" columns="3">
                        #{msgs.nome}:
                        <h:inputText id="nome" value="#{beanMinistrante.ministrante.nome}" 
                                     size="40" required="true"
                                     label="Nome" >
                            <f:validateLength minimum="3" maximum="50" />
                        </h:inputText>
                        <h:message for="nome" style="color:red" />    
                        Email:
                        <h:inputText id="email" value="#{beanMinistrante.ministrante.email}" 
                                     size="40" required="true"
                                     label="Email" >
                            <f:validateLength minimum="5" maximum="30" />
                        </h:inputText>
                        <h:message for="email" style="color:red" />
                        #{msgs.formacao}:
                        <h:selectOneListbox id="formacao" value="#{beanMinistrante.ministrante.formacao}" size="1">
                            <f:selectItems value="#{beanMinistrante.ministrante.mapaOpinioesPossiveis}"/>
                        </h:selectOneListbox>
                        <h:message for="formacao" style="color:red" />  

                        #{msgs.sexo}:
                        <h:selectOneRadio id="sexo" value="#{beanMinistrante.ministrante.sexo}" title="Sexo" required="true" label="Sexo">
                            <f:selectItem id="sm" itemLabel="#{msgs.Masculino}" itemValue="M" />
                            <f:selectItem id="sf" itemLabel="#{msgs.Feminino}" itemValue="F" />
                        </h:selectOneRadio>
                        <h:message for="sexo" style="color:red" />
                        CPF:
                        <h:inputText id="cpf" value="#{beanMinistrante.ministrante.cpf}" 
                                     size="11" required="true"
                                     label="CPF" >                                                
                        </h:inputText>
                        <h:message for="cpf" style="color:red" />    
                        RG:
                        <h:inputText id="rg" value="#{beanMinistrante.ministrante.rg}" 
                                     size="15" required="true"
                                     label="RG" >
                            <f:validateLength minimum="5" maximum="15" />
                        </h:inputText>
                        <h:message for="rg" style="color:red" />
                        #{msgs.telefone}:
                        <h:inputText id="telefone" value="#{beanMinistrante.ministrante.telefone}" 
                                     size="15" required="true"
                                     label="Telefone" >
                            <f:validateLength minimum="6" maximum="15" />
                        </h:inputText>
                        <h:message for="telefone" style="color:red" />
                    </h:panelGrid>
                    <h:commandButton value="#{msgs.salvar}" action="#{beanMinistrante.salvar}"/>
                    <h:commandButton value="#{msgs.cancelar}" id="cancelarinsercao" action="#{beanMinistrante.cancelar}" immediate="true"/>
                </h:form>
            </h:panelGroup>
        </ui:define>
    </ui:composition>
</html>